/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author amega
 */
@Entity
@Table(name = "hotelroom")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Hotelroom.findAll", query = "SELECT h FROM Hotelroom h"),
    @NamedQuery(name = "Hotelroom.findById", query = "SELECT h FROM Hotelroom h WHERE h.id = :id"),
    @NamedQuery(name = "Hotelroom.findByNumberRoom", query = "SELECT h FROM Hotelroom h WHERE h.numberRoom = :numberRoom"),
    @NamedQuery(name = "Hotelroom.findByCountSeats", query = "SELECT h FROM Hotelroom h WHERE h.countSeats = :countSeats"),
    @NamedQuery(name = "Hotelroom.findByCategory", query = "SELECT h FROM Hotelroom h WHERE h.category = :category"),
    @NamedQuery(name = "Hotelroom.findByPrice", query = "SELECT h FROM Hotelroom h WHERE h.price = :price"),
    @NamedQuery(name = "Hotelroom.findByTypeOfFood", query = "SELECT h FROM Hotelroom h WHERE h.typeOfFood = :typeOfFood"),
    @NamedQuery(name = "Hotelroom.findByClassification", query = "SELECT h FROM Hotelroom h WHERE h.classification = :classification")})
public class Hotelroom implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "numberRoom")
    private String numberRoom;
    @Basic(optional = false)
    @NotNull
    @Column(name = "countSeats")
    private int countSeats;
    @Size(max = 255)
    @Column(name = "category")
    private String category;
    @Basic(optional = false)
    @NotNull
    @Column(name = "price")
    private double price;
    @Lob
    @Size(max = 65535)
    @Column(name = "info")
    private String info;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "typeOfFood")
    private String typeOfFood;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "classification")
    private String classification;
    @JoinTable(name = "roomServiceNumber", joinColumns = {
        @JoinColumn(name = "idRoomNumber", referencedColumnName = "id")}, inverseJoinColumns = {
        @JoinColumn(name = "idRoomService", referencedColumnName = "id")})
    @ManyToMany
    private List<RoomService> roomServiceList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idRoomNumber")
    private List<Housekeeping> housekeepingList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idRoom")
    private List<RoomImg> roomImgList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idRoomNumber")
    private List<OrderRoom> orderRoomList;

    public Hotelroom() {
    }

    public Hotelroom(Integer id) {
        this.id = id;
    }

    public Hotelroom(Integer id, String numberRoom, int countSeats, double price, String typeOfFood, String classification) {
        this.id = id;
        this.numberRoom = numberRoom;
        this.countSeats = countSeats;
        this.price = price;
        this.typeOfFood = typeOfFood;
        this.classification = classification;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNumberRoom() {
        return numberRoom;
    }

    public void setNumberRoom(String numberRoom) {
        this.numberRoom = numberRoom;
    }

    public int getCountSeats() {
        return countSeats;
    }

    public void setCountSeats(int countSeats) {
        this.countSeats = countSeats;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getTypeOfFood() {
        return typeOfFood;
    }

    public void setTypeOfFood(String typeOfFood) {
        this.typeOfFood = typeOfFood;
    }

    public String getClassification() {
        return classification;
    }

    public void setClassification(String classification) {
        this.classification = classification;
    }

    @XmlTransient
    public List<RoomService> getRoomServiceList() {
        return roomServiceList;
    }

    public void setRoomServiceList(List<RoomService> roomServiceList) {
        this.roomServiceList = roomServiceList;
    }

    @XmlTransient
    public List<Housekeeping> getHousekeepingList() {
        return housekeepingList;
    }

    public void setHousekeepingList(List<Housekeeping> housekeepingList) {
        this.housekeepingList = housekeepingList;
    }

    @XmlTransient
    public List<RoomImg> getRoomImgList() {
        return roomImgList;
    }

    public void setRoomImgList(List<RoomImg> roomImgList) {
        this.roomImgList = roomImgList;
    }

    @XmlTransient
    public List<OrderRoom> getOrderRoomList() {
        return orderRoomList;
    }

    public void setOrderRoomList(List<OrderRoom> orderRoomList) {
        this.orderRoomList = orderRoomList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Hotelroom)) {
            return false;
        }
        Hotelroom other = (Hotelroom) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "domain.Hotelroom[ id=" + id + " ]";
    }
    
}
